using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;

namespace CMS.Data
{
    public interface IDao<T, IdT>
    {
        T GetById(IdT id, bool shouldLock);
        T GetById(IdT id);
        List<T> GetAll();
        List<T> GetByExample(T exampleInstance, params string[] propertiesToExclude);
        T GetUniqueByExample(T exampleInstance, params string[] propertiesToExclude);
        T Save(T entity);
        T SaveOrUpdate(T entity);
        void Delete(T entity);
        void CommitChanges();

        //Methodes extend
        bool Update(T entity);
        List<T> GetListIDs(String IDs);
        List<T> GetAllOrderField(string propertyOrder, bool isAsc);
        IList GetHQLMinMaxResult(String query, int min, int max);
        List<T> GetFieldLikeCriteria(string profertyName, string value);
        List<T> GetFieldEqualCriteria(string profertyName, object value);
        IList GetHQL(String query);
        List<T> GetHQLListT(String query);
        bool DeleteHQL(String query);
        bool DeleteListIDs(String IDs);
        bool IsExist(String fieldname, object value);
        bool IsExistBetween(String fieldname, object value1, object value2);
        bool IsExist(String fieldname, object value, String MaValue);
        List<T> GetAllOrderMoreFields(string[] propertiesOrder, bool isAsc);
    }
}
